package com.bjsxt.datastructure.stackqueue;

import java.util.Deque;
import java.util.LinkedList;

public class TestConvert {
    public static void main(String[] str) {
        int a = 13;
        int t = a;
        Deque stack = new LinkedList();
        while (t > 0) {
            int b = t % 2;//余数
            int c = t / 2;//商
            System.out.println(b);
            t = c;
            stack.push(b);
        }

        while (!stack.isEmpty()) {
            System.out.print(stack.pop());
        }
    }
}
